<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<script type="text/javascript">
	$('#userEditOzTree').combotree({
		url : '${ctx}/oz/tree.do',
		parentField : 'pid',
		lines : true,
        panelHeight : 400,
        panelWidth:300,
		value : '${user.organization.id}',
		onLoadSuccess : function() {
			$.messager.progress('close');
            $('#userEditOzTree').combotree('setValue', '${user.organization.id}');
		}
	});
	
	$(function() {
		$("#but").click(function() {
			if ($("#file2").val().length > 0) {
				ajaxFileUpload1();
			} else {
				alert("请选择图片");
			}
		});
	});
	function ajaxFileUpload1() {
		$.ajaxFileUpload({
			url : '${ctx}/tempimg', //用于文件上传的服务器端请求地址
			secureuri : false, //一般设置为false
			fileElementId : 'file2', //文件上传空间的id属性  <input type="file" id="file" name="file" />
			type : 'post',
			dataType : 'HTML', //返回值类型 一般设置为json
			success  : function(data, status) //服务器成功响应处理函数
			{
				$("#img2").attr("src", data);
				$("#path1").attr("value",data);
				if (typeof (data.error) != 'undefined') {
					if (data.error != '') {
						alert(data.error);
					} else {
						alert(data.msg);
					}
				}
			},
			error : function(data, status, e)//服务器响应失败处理函数
			{
				alert(e);
			}
		})
		return false;
	}
</script>

	<form id="userEdit_edit_form" method="post">
<table class="table">
		<input name="roleIds"  type="hidden" class="span2"  value="${user.roleIds}">
		<input name="password" type="hidden" class="span2" value="${user.password}">
		<input name="id" 	   type="hidden" class="span2" value="${user.id}"> 
		<input name="username" type="hidden" class="span2" value="${user.username}">
		<input name="rolename"   type="hidden" class="span2" value="${user.rolename}">
  <tr>
    <td width="70" height="40" align="center" valign="middle">姓名：</td>
    <td>
		<input style="width: 200px;" name="name" type="text" class="easyui-validatebox" data-options="required:true" value="${user.name}" >
	</td>
  </tr>
  <tr>
    <td height="40" align="center" valign="middle">性别：</td>
    <td width="322">
		<select name="sex" class="easyui-combobox"
				data-options="width:220,height:29,editable:false,panelHeight:'auto'">
					<option value="男">男</option>
					<option value="女">女</option>
		</select>
	</td>
  </tr>
  <tr>
    <td height="40" align="center" valign="middle">部门：</td>
    <td>
        <input name="oid" id="userEditOzTree"  type="text"
               class="easyui-validatebox span2"
               data-options="width:300,height:29,editable:false,panelHeight:'auto'">

	</td>
  </tr>
  <tr>

  </tr>
  <tr>
    <td height="40" align="center" valign="middle">执法证号：</td>
    <td>
		<input name="zfnumber"  type="text" placeholder="请输入执法证号"
				class="easyui-validatebox span2" style="width: 200px;" 
				>
	</td>
  </tr>
  <tr>
    <td height="40" align="center" valign="middle">手机：</td>
    <td>
		<input name="mobile"  type="text" placeholder="请输入手机机电话号码"
				class="easyui-validatebox span2" 
				data-options="validType:'phoneOrMobile'" maxlength="11"
				style="width: 200px;">
	</td>
  </tr>
	<tr>
		<td>职务：</td>
		<td colspan="3">
			<input name="osName"  type="text"
				   class="easyui-textbox" data-options="required:true"
				   style="width: 180px;height:29px;">
		</td>
	</tr>
</table>
  </form>
